/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.mto.module.karaoke.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import com.mto.module.karaoke.model.UserSongs;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing UserSongs in entity cache.
 *
 * @author vuonglm
 * @see UserSongs
 * @generated
 */
public class UserSongsCacheModel implements CacheModel<UserSongs>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(23);

		sb.append("{userSongId=");
		sb.append(userSongId);
		sb.append(", userId=");
		sb.append(userId);
		sb.append(", commentNumber=");
		sb.append(commentNumber);
		sb.append(", listenNumber=");
		sb.append(listenNumber);
		sb.append(", mark=");
		sb.append(mark);
		sb.append(", recodingUrl=");
		sb.append(recodingUrl);
		sb.append(", description=");
		sb.append(description);
		sb.append(", isShow=");
		sb.append(isShow);
		sb.append(", avatar=");
		sb.append(avatar);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", songId=");
		sb.append(songId);
		sb.append("}");

		return sb.toString();
	}

	public UserSongs toEntityModel() {
		UserSongsImpl userSongsImpl = new UserSongsImpl();

		userSongsImpl.setUserSongId(userSongId);
		userSongsImpl.setUserId(userId);
		userSongsImpl.setCommentNumber(commentNumber);
		userSongsImpl.setListenNumber(listenNumber);
		userSongsImpl.setMark(mark);

		if (recodingUrl == null) {
			userSongsImpl.setRecodingUrl(StringPool.BLANK);
		}
		else {
			userSongsImpl.setRecodingUrl(recodingUrl);
		}

		if (description == null) {
			userSongsImpl.setDescription(StringPool.BLANK);
		}
		else {
			userSongsImpl.setDescription(description);
		}

		userSongsImpl.setIsShow(isShow);

		if (avatar == null) {
			userSongsImpl.setAvatar(StringPool.BLANK);
		}
		else {
			userSongsImpl.setAvatar(avatar);
		}

		if (createDate == Long.MIN_VALUE) {
			userSongsImpl.setCreateDate(null);
		}
		else {
			userSongsImpl.setCreateDate(new Date(createDate));
		}

		userSongsImpl.setSongId(songId);

		userSongsImpl.resetOriginalValues();

		return userSongsImpl;
	}

	public long userSongId;
	public long userId;
	public int commentNumber;
	public int listenNumber;
	public int mark;
	public String recodingUrl;
	public String description;
	public boolean isShow;
	public String avatar;
	public long createDate;
	public long songId;
}